package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.SetmealDish;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SetmealDishMapper {

     /*
    * 根据菜品id批量查询套餐信息（返回）
    * */
    List<Long> selectDishIdByDishIds(List<Long> dishIds);

    /*
    * 批量添加套餐菜品信息
    * */
    @AutoFill(value = OperationType.INSERT)
    void insertSetmealDishBatch(List<SetmealDish> setmealDishes);

    /*
    * 删除套餐菜品关系表的信息
    * */
    void deleteSetmealDishByIds(List<Long> setmealIds);

     /*
     * 根据setmealId查询菜品套餐关系信息
     * */
    @Select("select * from setmeal_dish where setmeal_id = #{id}")
    List<SetmealDish> selectSetmealDishById(Long setmealId);


    /*
    * 根据dishId查询菜品套餐相关信息
    * */
    @Select("select * from setmeal_dish where dish_id = #{dishId}")
    List<SetmealDish> selectSetmealDishByDishId(Long dishId);
}
